import { JinchujiluBox } from "./style";
import Rukuangpingzheng from './components/Rukuangpingzheng'; // 出入凭证
import Rukuangjilu  from './components/Rukuangjilu'; // 入矿记录
import Chukuangjilu  from './components/Chukuangjilu'; // 出矿记录
import { useEffect, useState } from "react";
import { handleGetDictionaryItem } from "../../../assets/fun/DictionaryItem";
import { ISelectList } from "../../../type/antd";

/**
 * 进出记录页面
 * @author xiaoxujs
 * 2024-11-11
 */

const Jinchujilu = () => {
    const [carColorList, setCarColorList] = useState<ISelectList[]>([]); // 车辆类型字典项

    useEffect(() => {
        let carArr = handleGetDictionaryItem('CPYS');
        let carArr1: ISelectList[] = []
        carArr.forEach(element => {
            carArr1.push({
                value: element.label,
                label: element.label
            })
        });
        setCarColorList(carArr1);

        return () => {
        }
    }, [])
    
    return <JinchujiluBox>
        <Rukuangpingzheng carColorList = {carColorList} />
        <div className="xia_box">
            <Rukuangjilu  carColorList = {carColorList} />
            <Chukuangjilu carColorList = {carColorList}  />
        </div>
    </JinchujiluBox>
}

export default Jinchujilu;